package com.family.business.custom.service;

import java.util.Collection;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.family.business.custom.ajax.CustomJson;
import com.family.business.custom.dao.CustomIDao;
import com.family.business.custom.dto.CustomDto;

@Service("customService")
public class CustomService implements CustomIService{
	@Resource(name="customDao")
	private CustomIDao customDao;

	@Override
	public CustomDto getCustom(Long id) {
		
		return this.customDao.get(CustomDto.class, id);
	}

	@Override
	public void save(CustomDto custom) {
		this.customDao.save(custom);
	}

	@Override
	public void saveOrUpdate(CustomDto custom) {
		this.customDao.saveOrUpdate(custom);
	}

	@Override
	public void delete(CustomDto custom) {
		this.customDao.delete(custom);
	}

	@Override
	public void deleteByCollection(Collection<CustomDto> collection) {
		this.customDao.deleteAll(collection);
	}

	@Override
	public void deleteByPK(Long id) {
		this.customDao.delete(CustomDto.class, id);
	}

	@Override
	public CustomJson getCustomJson(Long id) {
		
		return null;
	}

	@Override
	public List<CustomJson> listCustomByName(String cusName) {
		return this.customDao.listCustomByName(cusName);
	}

	
}
